package com.youpingou.controller;

import com.youpingou.domain.Brand;
import com.youpingou.service.BrandService;
import com.youpingou.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @auther Created by yuanxinqi  
 */
@RestController
@RequestMapping
public class BrandController {

     @Autowired
    private BrandService brandService;

    @GetMapping("/brands/{cat3id}")
    public BaseResult findBrandByCat3id(@PathVariable("cat3id") Integer cat3Id){
        //调用Service实现功能
        List<Brand> list = brandService.findBrandByCat3Id(cat3Id);
        // 封装结果
        return BaseResult.ok(list);
    }



}